#!/bin/bash
echo "输入token:" && read -s token \
&&
phoneId=`curl -s -X POST 'https://cpability.buy.139.com/cloudphone/user/bookRecord' -H 'User-Agent: okhttp/4.2.2' -H 'Content-Type: application/json; charset=UTF-8' -H 'x-channelSrc: cloudphone_app_lenovo' -H 'x-NetType: 4G' -H 'x-DeviceInfo: 4G|Android|Carry You Home|1.0.0' -H 'appId: 12345678' -H "token: $token" -d '{"hideStatus":true,"pageNum":1,"pageSize":100}' |grep phoneId|awk '{print $1}'|sed 's/,/ /g'|sed 's/:/ /g'|sed 's/"/ /g'|sed 's/{/ /g'|awk '{print $25}'`
  ydyip=$(curl -s -X POST -H "content-type:application/json; charset=UTF-8" -H "token:$token" -d '{"phoneId":"'"$phoneId"'","authId":"","streamType":2}' "https://cloud.139.com/ulhw/cloudphone/user/instance/auth" |grep address|awk '{print $1}'|sed 's/,/ /g'|sed 's/:/ /g'|sed 's/"/ /g'|sed 's/{/ /g'|awk '{print $24}'|sed 's/ /:/g')
 port=$(curl -s -X POST -H "content-type:application/json; charset=UTF-8" -H "token:$token" -d '{"phoneId":"'"$phoneId"'","authId":"","streamType":2}' "https://cloud.139.com/ulhw/cloudphone/user/instance/auth" |grep address|awk '{print $1}'|sed 's/,/ /g'|sed 's/:/ /g'|sed 's/"/ /g'|sed 's/{/ /g'|awk '{print $26}'|sed 's/ /:/g')
  #echo "云手机IP:"$ydyip
  echo -e "$ydyip:$((${port}))" 10000
  echo -e "$ydyip:$((${port} + 1))" 10001
  echo -e "$ydyip:$((${port} + 2))" 10002
  echo -e "$ydyip:$((${port} + 3))" 10003
  echo -e "$ydyip:$((${port} + 4))" 10004
